home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000073_icon-group-sender _Wed Oct 11 14:45:00 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id OAA08274
  4.     for icon-group-addresses; Wed, 11 Oct 2000 14:42:08 -0700 (MST)
  5. Message-Id: <200010112142.OAA08274@baskerville.CS.Arizona.EDU>
  6. From: Steve Wampler <swampler@noao.edu>
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: can icon do this?
  9. Date: Wed, 11 Oct 2000 10:47:11 -0700
  10. X-Trace: noao.edu 971286434 35547 140.252.38.6 (11 Oct 2000 17:47:14 GMT)
  11. X-Complaints-To: abuse@noao.edu
  12. To: Antonella <gea@earthling.net>
  13. X-Accept-Language: en
  14. To: icon-group@optima.CS.Arizona.EDU
  15. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  16. Status: RO
  17. Content-Length: 656
  18.  
  19. Antonella wrote:
  20. > What code inspects one input text file, checks each line for occurrences
  21. > of a string, and if found replaces that string in an otherwise identical
  22. > output file?
  23.  
  24. Sure, this is possible to do in Icon, but if the output file really
  25. starts out identical to the input file, it's a *lot* easier to
  26. read the input file, modify the internal copy and then write it
  27. out as the new output file.  Is that acceptable?
  28.  
  29. Otherwise, you have to be careful if the length of the target and
  30. replacement strings differ - this introduces a spot of ugliness
  31. in the code.
  32.  
  33.  
  34. --
  35. Steve Wampler-  SOLIS Project, National Solar Observatory
  36. swampler@noao.edu
  37.